Class Needle
Class Needle
java.lang.Object
|
+----Needle
-
public class
Needle
-
extends Object
This maintain a Needle (or a hand).
-
Version:
-
1.0 29 November 1995
-
Author:
-
Nils Hedstr÷m
-
Needle(Color, Color, int, int, int, int, int, int, double)
-
Constructs a needle.
-
drawNeedle(Graphics)
-
Draws the needle on a graphics object.
-
setAngle(double)
-
Sets the angle of the needle.
Needle
public Needle(Color in_color,
Color in_border,
int in_type,
int in_width,
int in_centerx,
int in_centery,
int in_lengthx,
int in_lengthy,
double in_angle)
-
Constructs a needle.
-
Parameters:
-
in_color
-
The color
-
in_border
-
The color of the border (the border is 1 pixel wide)
-
in_type
-
The type (0=no Needle, 1=Triangle, 2=Rectangle, 3=Romb)
-
in_width
-
The witdh
-
in_centerx
-
The x-cord of the center
-
in_centery
-
The y-cord of the center
-
in_lengthx
-
The length in the x-axis
-
in_lengthy
-
The lenght in the y-axis
-
in_angle
-
The angle (0=To the right, pi=To the left)
setAngle
public void setAngle(double in_angle)
-
Sets the angle of the needle.
-
Parameters:
-
in_angle
-
The needle's new angle. (0=To the right, pi/2 Up, pi=Left, 3pi/2 Down)
drawNeedle
public void drawNeedle(Graphics g)
-
Draws the needle on a graphics object.
-
Parameters:
-
g
-
The graphics object which the needle will be drawn upon.